<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        class Person {
            name;
            #age;
            #weight

            constructor(name,age,weight){
                this.name = name;
                this.#age = age;
                this.#weight = weight
            }
            getter(){
                console.log(this.name);
                console.log(this.#age);
                console.log(this.#weight);
            }
        }

        const girl = new Person('晓红',18,'45kg');

        console.log(girl.name); 
        console.log(girl.#age); 
        console.log(girl.#weight); 
        girl.getter()
    </script>
</body>

</html>